Integrand size = 14, antiderivative size = 46 \[ \int \left (a+b \tan ^2(c+d x)\right )^2 \, dx=(a-b)^2 x+\frac {(2 a-b) b \tan (c+d x)}{d}+\frac {b^2 \tan ^3(c+d x)}{3 d} \]
[Out]
Time = 0.04 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3742, 398, 209} \[ \int \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {b (2 a-b) \tan (c+d x)}{d}+x (a-b)^2+\frac {b^2 \tan ^3(c+d x)}{3 d} \]
[In]
[Out]
Rule 209
Rule 398
Rule 3742
Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\left (a+b x^2\right )^2}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \left ((2 a-b) b+b^2 x^2+\frac {(a-b)^2}{1+x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {(2 a-b) b \tan (c+d x)}{d}+\frac {b^2 \tan ^3(c+d x)}{3 d}+\frac {(a-b)^2 \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d} \\ & = (a-b)^2 x+\frac {(2 a-b) b \tan (c+d x)}{d}+\frac {b^2 \tan ^3(c+d x)}{3 d} \\ \end{align*}
Time = 0.67 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.59 \[ \int \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {\tan (c+d x) \left (\frac {3 (a-b)^2 \text {arctanh}\left (\sqrt {-\tan ^2(c+d x)}\right )}{\sqrt {-\tan ^2(c+d x)}}+b \left (6 a-b \left (3-\tan ^2(c+d x)\right )\right )\right )}{3 d} \]
[In]
[Out]
Time = 0.05 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.07
method | result | size |
norman | \(\left (a^{2}-2 a b +b^{2}\right ) x +\frac {\left (2 a -b \right ) b \tan \left (d x +c \right )}{d}+\frac {b^{2} \tan \left (d x +c \right )^{3}}{3 d}\) | \(49\) |
derivativedivides | \(\frac {\frac {b^{2} \tan \left (d x +c \right )^{3}}{3}+2 a b \tan \left (d x +c \right )-b^{2} \tan \left (d x +c \right )+\left (a^{2}-2 a b +b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(59\) |
default | \(\frac {\frac {b^{2} \tan \left (d x +c \right )^{3}}{3}+2 a b \tan \left (d x +c \right )-b^{2} \tan \left (d x +c \right )+\left (a^{2}-2 a b +b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(59\) |
parallelrisch | \(\frac {b^{2} \tan \left (d x +c \right )^{3}+3 a^{2} d x -6 a b d x +3 b^{2} d x +6 a b \tan \left (d x +c \right )-3 b^{2} \tan \left (d x +c \right )}{3 d}\) | \(60\) |
parts | \(x \,a^{2}+\frac {b^{2} \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {2 a b \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) | \(63\) |
risch | \(x \,a^{2}-2 x a b +x \,b^{2}-\frac {4 i b \left (-3 a \,{\mathrm e}^{4 i \left (d x +c \right )}+3 b \,{\mathrm e}^{4 i \left (d x +c \right )}-6 a \,{\mathrm e}^{2 i \left (d x +c \right )}+3 b \,{\mathrm e}^{2 i \left (d x +c \right )}-3 a +2 b \right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}\) | \(92\) |
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.11 \[ \int \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {b^{2} \tan \left (d x + c\right )^{3} + 3 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} d x + 3 \, {\left (2 \, a b - b^{2}\right )} \tan \left (d x + c\right )}{3 \, d} \]
[In]
[Out]
Time = 0.12 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.48 \[ \int \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\begin {cases} a^{2} x - 2 a b x + \frac {2 a b \tan {\left (c + d x \right )}}{d} + b^{2} x + \frac {b^{2} \tan ^{3}{\left (c + d x \right )}}{3 d} - \frac {b^{2} \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tan ^{2}{\left (c \right )}\right )^{2} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.38 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.26 \[ \int \left (a+b \tan ^2(c+d x)\right )^2 \, dx=a^{2} x - \frac {2 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a b}{d} + \frac {{\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} b^{2}}{3 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 359 vs. \(2 (44) = 88\).
Time = 0.47 (sec) , antiderivative size = 359, normalized size of antiderivative = 7.80 \[ \int \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {3 \, a^{2} d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 6 \, a b d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} + 3 \, b^{2} d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 9 \, a^{2} d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 18 \, a b d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 9 \, b^{2} d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 6 \, a b \tan \left (d x\right )^{3} \tan \left (c\right )^{2} + 3 \, b^{2} \tan \left (d x\right )^{3} \tan \left (c\right )^{2} - 6 \, a b \tan \left (d x\right )^{2} \tan \left (c\right )^{3} + 3 \, b^{2} \tan \left (d x\right )^{2} \tan \left (c\right )^{3} + 9 \, a^{2} d x \tan \left (d x\right ) \tan \left (c\right ) - 18 \, a b d x \tan \left (d x\right ) \tan \left (c\right ) + 9 \, b^{2} d x \tan \left (d x\right ) \tan \left (c\right ) - b^{2} \tan \left (d x\right )^{3} + 12 \, a b \tan \left (d x\right )^{2} \tan \left (c\right ) - 9 \, b^{2} \tan \left (d x\right )^{2} \tan \left (c\right ) + 12 \, a b \tan \left (d x\right ) \tan \left (c\right )^{2} - 9 \, b^{2} \tan \left (d x\right ) \tan \left (c\right )^{2} - b^{2} \tan \left (c\right )^{3} - 3 \, a^{2} d x + 6 \, a b d x - 3 \, b^{2} d x - 6 \, a b \tan \left (d x\right ) + 3 \, b^{2} \tan \left (d x\right ) - 6 \, a b \tan \left (c\right ) + 3 \, b^{2} \tan \left (c\right )}{3 \, {\left (d \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 3 \, d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 3 \, d \tan \left (d x\right ) \tan \left (c\right ) - d\right )}} \]
[In]
[Out]
Time = 10.43 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.65 \[ \int \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (2\,a\,b-b^2\right )}{d}+\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,{\left (a-b\right )}^2}{a^2-2\,a\,b+b^2}\right )\,{\left (a-b\right )}^2}{d}+\frac {b^2\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,d} \]
[In]
[Out]